<!doctype html>
<html class="x-admin-sm" lang="zh">
    <head>
        <meta charset="UTF-8">
        <title>后台登录-X-admin2.2</title>
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <script src="js/jquery3.3.1.min.js"></script>
        <script src="js/vue3.js"></script>
    </head>
    <body class="index">


        <!-- 左侧菜单开始 -->
        <div class="left-nav">
            <div id="side-nav">
                <ul id="nav">
                    <li v-for="mod in mods" v-if="mod.is_parent==0">
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" :lay-tips="mod.mod_name">&#xe6b8;</i>
                            <cite>{{mod.mod_name}}</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>

                        <ul class="sub-menu">
                            <li v-for="smod in mods" v-if="smod.parent_mod_id==mod.mod_id">
                                <a @click="add_tab(smod.mod_name,smod.url)">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>{{smod.mod_name}}</cite></a>
                            </li>

                        </ul>

                    </li>

                </ul>
            </div>
        </div>


    <script>

        const nav = {
            data() {
                return {
                    mods: null
                }
            },
            methods:{
                add_tab:function(name, url){

                }
            },
            mounted:function () {
                var _self = this;
                alert("hello");
            }



                    // $.ajax({
                    //     url: "/hasModules",
                    //     beforeSend: function () {
                    //     },
                    //     complete: function () {
                    //
                    //     },
                    //     success: function (res) {
                    //         _self.mods = res;
                    //     }
                    // });

        };

        Vue.createApp(nav).mount("#nav");
    </script>

    </body>

</html>